package com.xyz.controller;

import com.xyz.entity.response.LoginResponse;
import com.xyz.entity.response.ResultResponse;
import com.xyz.entity.request.LoginRequest;
import com.xyz.service.SystemService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 夏永泽
 * @date 2022/4/1
 */
@RestController
public class LoginController {
    private final SystemService service;

    public LoginController(SystemService service) {
        this.service = service;
    }

    @PostMapping("/login")
    public ResultResponse<LoginResponse> login(@RequestBody LoginRequest request) {
        LoginResponse result = this.service.login(request);
        return ResultResponse.success(result);
    }

}
